﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using fhjlDAL;
using fhjlDAL.wfFHJLDataSetTableAdapters;
using Common;
using WFNetLib.Log;
namespace fhjlBLL
{
    public class 供热公司BLL
    {
        SystemLogData l = new SystemLogData();
        public 供热公司BLL()
        {
            l.LogType = LogType.信息管理.ToString();            
            l.LogRemark = "供热公司";            
        }
        public DataTable Select(供热公司Data data)
        {            
            供热公司TableAdapter adapter = new 供热公司TableAdapter();
            fhjlDAL.wfFHJLDataSet.供热公司DataTable dt = new fhjlDAL.wfFHJLDataSet.供热公司DataTable();
            //mcuDAL.ArticleDAL item = new mcuDAL.ArticleDAL();
            adapter.Fill(dt,data.SQLType,data.ID,data.名称);
            return dt;
        }
        public int Insert(供热公司Data data)
        {
            供热公司TableAdapter adapter = new 供热公司TableAdapter();            
            l.LogContent = "新建\"" + data.名称 + "\"信息";
            l.Operator = data.Operator;
            l.InserSQLLog();
            return adapter.InsertQuery(data.名称, data.地址, data.备注, data.IsAvailable, data.Operator, data.AddTime);
        }
        public int Update(供热公司Data data)
        {
            供热公司TableAdapter adapter = new 供热公司TableAdapter();            
            l.LogContent = "更改\""+data.名称+"\"信息";            
            l.Operator = data.Operator;
            l.InserSQLLog();
            return adapter.UpdateQuery(data.名称, data.地址, data.备注, data.IsAvailable, data.Operator, data.AddTime, data.ID);
        }
        public int Delete(供热公司Data data)
        {
            供热公司TableAdapter adapter = new 供热公司TableAdapter();
            l.LogContent = "删除\"" + data.名称 + "\"信息";
            l.Operator = data.Operator;
            l.InserSQLLog();
            return adapter.DeleteQuery(data.ID);
        }
    }
}
